<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/statics/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<table border="1">
    <tr>
        <th colspan="3">手机信息</th>
    </tr>
    <tr>
        <th>品牌型号</th>
        <th>参考报价</th>
        <th>操作</th>
    </tr>
    <c:forEach var="list" items="${requestScope.list}">
        <tr>
            <td>${list.nameType}</td>
            <td>${list.price}</td>
            <td><a href="select/${list.hsId}">详细</a> <a href="javascript:void(0)" onclick="del('${list.hsId}')">删除</a></td>
        </tr>
    </c:forEach>
</table>
<script type="text/javascript">
    function del(hsId){
        if (confirm("确定要删除吗?")){
            $.get("${pageContext.request.contextPath}/delete/"+hsId,function (d) {
                if (d=="1"){
                    alert("删除成功");
                    location.href="${pageContext.request.contextPath}/List";
                }else {
                    alert("删除失败")
                }
            })
        }

    }
</script>
</body>
</html>

